package com.wl.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wl.dao.Check_05Mapper;
import com.wl.entity.Check_05;
import com.wl.service.Check_05Service;
import com.wl.util.PageData;

@Service
public class Check_05ServiceImpl implements Check_05Service {
	@Autowired
	private Check_05Mapper cm;
	@Autowired
	private PageData<Check_05> pd;

	@Override
	public int deleteByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return cm.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(Check_05 record) {
		// TODO Auto-generated method stub
		return cm.insert(record);
	}

	@Override
	public int insertSelective(Check_05 record) {
		// TODO Auto-generated method stub
		return cm.insertSelective(record);
	}

	@Override
	public Check_05 selectByPrimaryKey(Integer id) {
		// TODO Auto-generated method stub
		return cm.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(Check_05 record) {
		// TODO Auto-generated method stub
		return cm.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Check_05 record) {
		// TODO Auto-generated method stub
		return cm.updateByPrimaryKey(record);
	}

	@Override
	public PageData<Check_05> listCheck_05sByPage(String keywords, Integer page, Integer pageSize) {
		// TODO Auto-generated method stub
		if (page < 1) {
			page = 1;
		}
		int start = (page - 1) * pageSize;
		System.out.println("service实现类的keywords:" + keywords);
		List<Check_05> list1 = listCheck_05sByKeywords(keywords);
		List<Check_05> list = cm.listCheck_05sByPage(keywords, start, pageSize);
		pd.setCode(0);
		pd.setData(list);
		pd.setMsg("");
		pd.setLimit(pageSize);
		pd.setPage(page);
		pd.setCount(list1.size());
		return pd;
	}

	@Override
	public List<Check_05> listCheck_05sByKeywords(String keywords) {
		// TODO Auto-generated method stub
		return cm.listCheck_05sByKeywords(keywords);
	}

	@Override
	public PageData<Check_05> listCheck_05_waitByPage(String keywords, Integer page, Integer pageSize) {
		// TODO Auto-generated method stub
		if (page < 1) {
			page = 1;
		}
		int start = (page - 1) * pageSize;
		System.out.println("service实现类的keywords:" + keywords);
		List<Check_05> list1 = listCheck_05_wait(keywords);
		List<Check_05> list = cm.listCheck_05_waitByPage(keywords, start, pageSize);
		pd.setCode(0);
		pd.setData(list);
		pd.setMsg("");
		pd.setLimit(pageSize);
		pd.setPage(page);
		pd.setCount(list1.size());
		return pd;
	}

	@Override
	public PageData<Check_05> listCheck_05_approvedByPage(String keywords, Integer page, Integer pageSize) {
		// TODO Auto-generated method stub
		if (page < 1) {
			page = 1;
		}
		int start = (page - 1) * pageSize;
		System.out.println("service实现类的keywords:" + keywords);
		List<Check_05> list1 = listCheck_05_approved(keywords);
		List<Check_05> list = cm.listCheck_05_approvedByPage(keywords, start, pageSize);
		pd.setCode(0);
		pd.setData(list);
		pd.setMsg("");
		pd.setLimit(pageSize);
		pd.setPage(page);
		pd.setCount(list1.size());
		return pd;
	}

	@Override
	public List<Check_05> listCheck_05_wait(String keywords) {
		// TODO Auto-generated method stub
		return cm.listCheck_05_wait(keywords);
	}

	@Override
	public List<Check_05> listCheck_05_approved(String keywords) {
		// TODO Auto-generated method stub
		return cm.listCheck_05_approved(keywords);
	}

}
